<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>鼠标事件</title>
</head>
<body>

</body>
<script>
    // click 点击事件
    // mousedown 鼠标按下
    // mousemove 鼠标移动
    // mouseup 鼠标弹起
    // contextmenu 右键菜单
    // mouseover 鼠标移入
    // mouseout 鼠标移除
    // mouseenter 鼠标移入 h5
    // mouseleave 鼠标移除 h5

    // 判断鼠标左右键
    document.onmousedown = function (e) {
        if (e.button == 0) {
            console.log('left');
        }else if (e.button == 1) {
            console.log('center');
        }else{
            console.log('right');
        }
    }
</script>
</html>
